<?php
$IP = $_SERVER["REMOTE_ADDR"];
session_start();
include "include/config.php";
include "include/functions.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Tracker</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">
	<p>Tracker</p>
	<div id="topMenuContainer">
	 	<div id="topMenu">
		<ul>
		<?php
			if($_SESSION["Admin"] == true && $_SESSION["Logged_In"] == true)
			{	
				echo "<li><a href=\"/Home\">Home</a></li>";
				echo "<li><a href=\"/Register\">Register</a></li>";
				echo "<li><a href=\"/Login\">Login</a></li>";
				echo "<li><a href=\"/Browse\">Browse</a></li>";
				echo "<li><a href=\"/Faq\">Faq</a></li>";
				echo "<li><a href=\"/Upload\">Upload</a></li>";
				echo "<li><a href=\"/Userpage\">Userpage</a></li>";
				echo "<li><a href=\"/Contact\">Contact</a></li>";
				echo "<li><a href=\"/Logout\">Logout</a></li>";
			}
			else if($_SESSION["Logged_In"] == true)
			{
				echo "<li><a href=\"/Home\">Home</a></li>";
				echo "<li><a href=\"/Browse\">Browse</a></li>";
				echo "<li><a href=\"/Faq\">Faq</a></li>";
				echo "<li><a href=\"/Upload\">Upload</a></li>";
				echo "<li><a href=\"/Userpage\">Userpage</a></li>";
				echo "<li><a href=\"/Contact\">Contact</a></li>";
				echo "<li><a href=\"/Logout\">Logout</a></li>";
			}
			else if($_SESSION["Logged_In"] != true)
			{
				echo "<li><a href=\"/Home\">Home</a></li>";
				echo "<li><a href=\"/Register\">Register</a></li>";
				echo "<li><a href=\"/Login\">Login</a></li>";
				echo "<li><a href=\"/Browse\">Browse</a></li>";
				echo "<li><a href=\"/Faq\">Faq</a></li>";
				echo "<li><a href=\"/Contact\">Contact</a></li>";
			}
		?>
		</ul>
	 	</div>
	</div>
</div>

<div id="bodyContainer">
	<div id="bodyLeft">
	<?php
	switch($_GET["page"])
	{
		case Login:
			include "include/login.php";
			break;

		case Register:
			include "include/register.php";
			break;
	
		case Browse:
			include "include/browse.php";
			break;
				
		case Upload:
			include "include/upload.php";
			break;
			
		case Admin:
			include "include/admin.php";
			break;
			
		case Logout:
			include "include/logout.php";
			break;
		
		case Userpage:
			include "include/userpage.php";
			break;
			
		case Home:
			include "include/home.php";
			break;
			
		case TorrentInfo:
			include "include/TorrentInfo.php";
			break;
			
		case Contact:
			include "include/Contact.php";
			break;
		
		default:
			include "include/home.php";
			break;
	}
	?>
    </div>

</div>
<div id="bodyRight">
	<h2><a href=#>New Torrents</a></h2>
		<ul>
			<li><a href="#">1</a> </li>
			<li><a href="#">2</a> </li>
			<li><a href="#">3</a> </li>
			<li><a href="#">4</a> </li>
			<li><a href="#">5</a> </li>
		</ul>
	<h2><a href=#>Top Downloads</a></h2>
		<ul>
			<li><a href="#">1</a> </li>
			<li><a href="#">2</a> </li>
			<li><a href="#">3</a> </li>
			<li><a href="#">4</a> </li>
			<li><a href="#">5</a> </li>
		</ul>
	<h2><a href=#>Most seeders</a></h2>
		<ul>
			<li><a href="#">1</a> </li>
			<li><a href="#">2</a> </li>
			<li><a href="#">3</a> </li>
			<li><a href="#">4</a> </li>
			<li><a href="#">5</a> </li>
		</ul>
</div>
	<div id="footer">
		<p>fot!</p>
	</div>
</body>
</html>
